package com.jasony.tools.excel.typehandler;

import org.apache.poi.ss.usermodel.Cell;

import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;

public class LocalDateTypeHandler implements TypeHandler<LocalDate> {
    @Override
    public void write(LocalDate source, Cell cell) {
        Date date = Date.from(source.atTime(0,0).atZone(ZoneId.systemDefault()).toInstant());
        cell.setCellValue(date);
    }
}
